home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2925 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: gryphon.phoenix.net!usenet
  2. From: "John F. Navratil" <jfn@phoenix.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Secure from Decompiling??
  5. Date: Wed, 24 Jan 1996 19:13:48 -0800
  6. Message-ID: <3106F56C.5D13@phoenix.net>
  7. References: <4djaq2$jd5@earth.superlink.net> <4e0e5iINN5qs@keats.ugrad.cs.ubc.ca>
  8. NNTP-Posting-Host: dial17.phoenix.net
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b3 (Win16; I)
  13.  
  14. Kazimir Kylheku wrote:
  15. > In article <4djaq2$jd5@earth.superlink.net>,
  16. > Bob Stewart <rstewart@mars.superlink.net> wrote:
  17. > > I have a compiled C program containing a string that I want no one to
  18. > >be able to see, even with a decompiler.
  19. > >
  20. > >Is there any thing to put in the code that can prevent it from being
  21. > >decompiled, or make the decompiled code unintelligle??
  22. > Not possible. You can only make things tedious and difficult, but that will not
  23. > thwart a resourceful and sophisticated enemy.
  24. > You see, the code must always be intelligible to the CPU, and the actions of a
  25. > CPU are neatly deterministic.
  26. > Your program will, at some point, need to decrypt the string, and this
  27. > execution can be traced.
  28. > What you can do is never decrypt the string, but this is probably useless to
  29. > you :)
  30. > --
  31.  
  32.  
  33. True, no code can ever be indefinitely secure from cracking.  The 
  34. practical solution is to make it economically foolish to do so.
  35.  
  36. For example, battlefield commands must resist cracking for only the time 
  37. it takes to target the guns.  Once the first round is fired, the enemy 
  38. knows where you are shooting. In this case, a relatively inexpensive 
  39. coding can keep large resources busy for long enough to get the job done.
  40.  
  41. Banks must secure transactions for a slightly longer period of time.
  42.  
  43. You haven't said what the string is, but I assume it is some "key" which 
  44. matches some "lock" to protect unauthorized use of your program.  Your 
  45. task is to protect the key so that people will get it through an 
  46. authorized channel.  If the key is worth $20, all you have to do is put a 
  47. $21 hurdle in the way.  If the key is worth more, you must do more.  You 
  48. can easily detect simple tampering with CRCs, etc.  If you must transform 
  49. the key through some decryption process, do so in a way that the 
  50. decrypted key is never visible.  Maybe you should encrypt the lock.
  51. Look into trap-door functions which give you a many-to-one transformation 
  52. from free-text to encoded text.
  53.  
  54. Don't worry about someone breaking your code and reselling it.  It 
  55. requires many co-conspirators which are too easily detectable.
  56.  
  57. Cheers!
  58.  
  59. -- John
  60.